<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
String path = request.getContextPath();
String basepath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>打印页面</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <link href="<%=basepath%>css/index.css" rel="stylesheet" type="text/css">
    <link href="<%=basepath%>css/print.css" rel="stylesheet" type="text/css">
    <script src="<%=basepath%>js/jquery-1.8.3.min.js"></script>
    <script src="<%=basepath%>js/layer/layer.js"></script>
    <script src="<%=basepath%>js/jquery.PrintArea.js"></script>
</head>
<body>
<div class="viewport">
   <div class="header">
       <div class="header-1">
           <a href="javascrpt:void(0)" id="join" class="header-2">
              <span id="account" class="account">${empty user.realName ? '' : user.realName}</span>&nbsp;&nbsp;<span id="deptName" class="deptName">${user.departmentName}</span>
           </a>
           <a href="/wape-web/api/core/centerService?serviceCode=WJ9999&targetURL=yuexi&prefix=3g_mmzs&entrance=yes" class="back" id="back">返回</a>
           <span class="span-num">WMP22600</span>
       </div>
    </div>
   <div class="content m-top" id="print">
       <div class="content-1"><span style="float:left;font-size:14px;">市场管理收费凭证</span><span>${user.realName}</span><span style="float:right;" id="sj"></span></div>
       <script type="text/javascript">
       /*时间*/
       function getNowFormatDate() {
           var date = new Date();
           var seperator1 = "-";
           var seperator2 = ":";
           var month = date.getMonth() + 1;
           var strDate = date.getDate();
           if (month >= 1 && month <= 9) {
               month = "0" + month;
           }
           if (strDate >= 0 && strDate <= 9) {
               strDate = "0" + strDate;
           }

           var hours = date.getHours()>9?date.getHours():("0"+date.getHours());
           var minutes = date.getMinutes()>9?date.getMinutes():("0"+date.getMinutes());
           var seconds = date.getSeconds()>9?date.getSeconds():("0"+date.getSeconds());
           var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                   + " " + hours + seperator2 + minutes
                   + seperator2 + seconds;
           sj.innerHTML=currentdate;
       }
       setInterval("getNowFormatDate()",0);
       </script>
       <div class="content-2">
           <table>
              <tr>
                  <td>${cp.plateNum}</td>
                  <td></td>
                  <td>${cp.dispatcherId}</td>
                  <td>${cp.inRecordNum}</td>
              </tr>
              <tr>
                  <td>${cp.storeName}</td>
                  <td>${cp.sonStoreName}</td>
                  <td>调度员：${cp.dispatcherName}</td>
                  <td>${cp.syncTime}</td>
              </tr>
           </table>
       </div>
       <div class="content-2">
           <table>
              <tr>
                  <td>${cp.goodsKingdom}--${cp.goodsInfo}</td>
                  <td>备注：<span>${cp.remark}</span></td>
              </tr>
           </table>
       </div>
       <div class="content-3">
           <table>
              <tr>
                  <td>项目</td>
                  <td>单价</td>
                  <td>单位</td>
                  <td>数(重)量</td>
                  <td>合计</td>
              </tr>
              <tr>
                  <td>经营管理费</td>
                  <td>${cp.rate}</td>
                  <td>元/吨</td>
                  <td>${cp.count}</td>
                  <td>${cp.costs}</td>
              </tr>
           </table>
       </div>
       <div class="blank"></div>
       <div class="content-4">
           <div class="content-4-1">
              <span style="font-size:14px;position:relative;left:-10%;">优惠金额：<span>${cp.benefit}</span>元</span>
              <span style="font-size:14px;position:relative;left:10%;">实收金额：<b>${cp.payment}</b>元</span>
           </div>
       </div>
   </div>
   <div class="content">
       <div class="blank"></div>
       <div class="content-1"><input type="button" value="重新打印" id="button"></div>
   </div>
</div>
</body>
<script type="text/javascript">
    /*错误提示*/
    $(function(){
        var error = "${requestScope.returnMsg}";
        if(error != "" && error != "成功!"){
            layer.msg(error,{shadeClose:true,shade:0.1,time:2000});
        }
    });
    $(function(){
        $("#button").click(function(){
            layer.confirm('重新打印单据，您确定？',{
                icon: 3,
                title:'打印单据'
            },function(sure){
                layer.closeAll();
                $("#print").printArea();
            });
        });
    });
    /*打印*/
    $(function(){
        $("#print").printArea();
    });
    
</script>
</html>


